home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.4 Applications 1997 August / SGI IRIX 6.4 Applications 1997 August.iso / dist / mmailp.idb / usr / lib / Zmail / custom.zmailrc.z / custom.zmailrc
Encoding:
Text File  |  1997-01-22  |  3.4 KB  |  113 lines

  1. function startup_hook() {
  2.     if $?MAIL
  3.         set __smf=$MAIL
  4.     else
  5.         if $?mail
  6.             set __smf=$mail
  7.         else
  8.             set __smf=/var/mail/$user
  9.         endif
  10.     endif
  11.  
  12.     if ! -e $__smf
  13.         if $user != "root"
  14.             if $user != "guest"
  15.                 set __mfletter=$ZMLIB/doc/.mfletter
  16.                 if -e $__mfletter
  17.                     if $?create_sys_folder
  18.                         mail -U -H $__mfletter -s "Creating mail folder..." $user
  19.                         opensmf
  20.                     endif
  21.                 endif
  22.             endif
  23.         endif
  24.     endif
  25.  
  26.     if $?saved_by_version
  27.         if "$saved_by_version" != "$version"
  28.             set verify += split_send
  29.  
  30.             if -e $HOME/.forward
  31.                 if $?dot_forward
  32.                     echo -d -p 'The version of MediaMail you have just installed enables the receiving of very\nlarge messages that have been split into pieces small enough for most mail\nsystems to handle. To use this new functionality, you must modify the\n.forward file in your home directory. Please refer to the online help section\non "MediaMail and Your .forward File" for modification instructions.'
  33.                 endif
  34.             endif
  35.         endif
  36.     endif
  37.  
  38.     if $?dot_forward
  39.         if ! -e $HOME/.forward
  40.             if $user != "root"
  41.                 ask -m 'In order to be able to reassemble very large messages that could be sent in\npieces to you, a .forward file must be created and placed in your home\ndirectory.\n\nChoose Yes below to create the .forward file and therefore be able to\nreassemble very large, split messages.\n\nChoose No to continue without creating a .forward file. Very large, split\nmessages may appear in your mailbox in pieces and will not be reassembled.\n\nTo inhibit this dialog, choose Variables from the Options menu of the MediaMail\nwindow and unset the dot_forward variable. For more information on setting\nup a .forward file, refer to the Help section on "MediaMail and the .forward file".'
  42.                 if $status == 0
  43.                     sh "echo '|/usr/lib/Zmail/bin/reassembler' > $HOME/.forward"
  44.                     sh "chmod 644 $HOME/.forward"
  45.                 endif
  46.             endif
  47.         endif
  48.     endif
  49.  
  50.     zmenu_set_tmpdir
  51.     foreach pending ( /var/mail/$user.partials/* ) 'check_partials $pending'
  52.  
  53.     if -e $HOME/.vacation_set
  54.         echo -d "Reminder: Vacation program is still set"
  55.     endif
  56.  
  57.     if is_gui
  58.         sh zmailrc_backup
  59.     endif
  60. }
  61.     
  62. function opensmf() {
  63.     if $?recursive
  64.         set __recursive = "$recursive"
  65.     else
  66.         set recursive
  67.         unset __recursive
  68.     endif
  69.     
  70.     set __sleep_counter = 0
  71.     ropensmf
  72.     
  73.     if $?__recursive
  74.         set recursive = "$__recursive"
  75.     else
  76.         unset recursive
  77.     endif
  78. }
  79.     
  80. function ropensmf() {
  81.     if -e $__smf
  82.         open %
  83.     else
  84.         sh sleep 1
  85.         arith __sleep_counter = "$__sleep_counter" + 1
  86.         if $__sleep_counter < 20
  87.             ropensmf
  88.         endif
  89.     endif
  90. }
  91.  
  92. function check_partials() {
  93.     set __output=$__tmpdir/check-$$
  94.     if -e $__output
  95.         remove -f $__output
  96.     endif
  97.     
  98.     sh "$ZMLIB/bin/check-partials $1 > $__output"
  99.  
  100.     if ! -z $__output
  101.     page $__output
  102.     endif
  103.  
  104.     if -e $__output
  105.         remove -f $__output
  106.     endif
  107. }
  108.  
  109. function reassemble() {
  110.     foreach m `pick -h content-type message/partial` \
  111.         'pipe $m /usr/lib/Zmail/bin/reassembler ; delete $m'
  112. }
  113.